const { dbUserAmend } = require('../model/user')

const userAmend = (req, res) => {
    const { account, newPassword } = req.body
    dbUserAmend(account, newPassword).then(data => {
        if (data.length === 0) {
            res.send({ code: 2001 })
        } else {
            res.send({ code: 200 })
        }
    }).catch(err => {
        res.send(err)
    })
}

module.exports = {
    userAmend
}